<?php include('header.php'); ?>

<!-- additional javascript hear -->

<!-- begine tipsy --> 
<link rel="stylesheet" href="<?=base_url();?>application/css/tipsy.css" type="text/css" />
<script type="text/javascript" src="<?=base_url();?>application/scripts/jquery.tipsy.js"></script>
<!-- end tipsy -->

<script type='text/javascript'>
  $(function() {
	 $('.tipsy-fade').tipsy({gravity: $.fn.tipsy.autoNS});
 });
</script>

</head>
<body>
<div id="wrapper">

	<!-- Badges -->
	<div class="badges-inner-left">
	<div class="badges-text">Mode<br />Mainternance</div>
	</div>
	

<!-- menu -->
<?php include('menu.php'); ?>
<!-- end menu -->

<!-- navigator -->
<?php include('navigator.php'); ?>
<!-- nav end -->
<?php
if($this->session->flashdata('success'))
{
    echo "<h2><div class='success'>".$this->session->flashdata('success')."</div></h2>";
}
?>
<div class="container">

	<div class="span-700">
		
		<div class="item">				
		<p>
		<iframe src="<?=base_url();?>map" frameborder="no" width="710" height="290" scrolling="no" class="border-object"></iframe> 
		</p>
		</div>

		<div class="item">
		<h2>last pictures</h2>
		<? #print_r($lastPhoto) . '\n';
		foreach($lastPhoto as $row):
		?>
		<a class="tipsy-fade" href="<?=base_url();?>photo/id/<?=$row['photo_id'];?>" title="<?=$row['location'];?>"><img src="<?=base_url();?>application/userdata/profile_<?=$row['user_id'];?>/photos/thumbs/<?=$row['caption'];?>"  alt="<?=$row['location'];?>" width="42px" height="42px"/></a>
		  <? endforeach; ?>
		  <hr />
		</div>

		<div class="item">
		<h2>top hit</h2>
		<? #print_r($popularPhoto) . '\n';
		foreach($popularPhoto as $row):
		?>
		<a class="tipsy-fade" href="<?=base_url();?>photo/id/<?=$row['photo_id'];?>" title="<?=$row['location'];?>"><img src="<?=base_url();?>application/userdata/profile_<?=$row['user_id'];?>/photos/thumbs/<?=$row['caption'];?>"  alt="<?=$row['location'];?>" width="42px" height="42px"/></a>
		<? endforeach; ?>
		<hr />
		</div>
	
		<div class="item">
		<h2>activity</h2>
		<? #print_r($eventPhoto) . '\n';
		foreach($eventPhoto as $row):
		?>
		<a class="tipsy-fade" href="<?=base_url();?>photo/id/<?=$row['photo_id'];?>"  title="<?=$row['location'];?>"><img src="<?=base_url();?>application/userdata/profile_<?=$row['user_id'];?>/photos/thumbs/<?=$row['caption'];?>"  alt="<?=$row['location'];?>" width="42px" height="42px"/></a>
		<? endforeach; ?>
		<hr />
		</div>
	
		<div class="item">
		<h2>food chords</h2>
		<? #print_r($foodPhoto) . '\n';
		foreach($foodPhoto as $row):
		?>
		<a class="tipsy-fade" href="<?=base_url();?>photo/id/<?=$row['photo_id'];?>"  title="<?=$row['location'];?>"><img src="<?=base_url();?>application/userdata/profile_<?=$row['user_id'];?>/photos/thumbs/<?=$row['caption'];?>"  alt="<?=$row['location'];?>" width="42px" height="42px"/></a>
		  <? endforeach; ?>
		  <hr />
		</div>
	
		<div class="item">
		<h2>travel</h2>
		<? #print_r($travelPhoto) . '\n';
		foreach($travelPhoto as $row):
		?>
		<a class="tipsy-fade" href="<?=base_url();?>photo/id/<?=$row['photo_id'];?>"  title="<?=$row['location'];?>"><img src="<?=base_url();?>application/userdata/profile_<?=$row['user_id'];?>/photos/thumbs/<?=$row['caption'];?>"  alt="<?=$row['location'];?>" width="42px" height="42px"/></a>
		  <? endforeach; ?>
		  <hr />
		</div>
	</div>

<!-- side bar right -->
<div class="sidebar last">
<?php
	if ($this->session->userdata('userId') != '') {
?>
	<div class="item">
	<h2>profile</h2>
	<table width="100%" border="0" cellpadding="0" cellspacing="2">
	  <tr>
	    <td width="3%" rowspan="8" align="left" valign="top"><img src="<?=$this->usermodel->getAvatar($this->session->userdata('userId'));?>"></td>
	    <td width="97%" valign="top" ><b><?=$this->usermodel->getName($this->session->userdata('userId'));?></b></td>
	    </tr>
	  <tr>
	    <td valign="top">สถานะ : <?=$this->usermodel->getAbout($this->session->userdata('userId'));?></td>
	    </tr>
	  <tr>
	    <td valign="top">:: <?php echo anchor('profile', 'โปรไฟล์ของฉัน'); ?></td>
	    </tr>
	  <tr>
	    <td valign="top">:: <?=anchor('profile/edit/', 'แก้ไขข้อมูล');?></td>
	    </tr>
	  <tr>
	    <td valign="top">:: <?=anchor('profile/uploadAvatar', 'เปลี่ยนรูปประจำตัว');?></td>
	    </tr>
	  <tr>
	    <td valign="top">:: <?=anchor('profile/changePassword', 'เปลี่ยนรหัสผ่าน');?></td>
	    </tr>
	  <tr>
	    <td valign="top">:: <?php echo anchor('logout', 'ออกจากระบบ'); ?></td>
	    </tr>
	  </table>
	</div>
<?php } else { ?>
    <div class="item">
	<h2>sign in</h2>
    <?php echo form_open('login');?>
          <label>Email:</label> 
          <input class="input-text" name="email" type="text" size="40" /> 
          <label>Password:</label> 
          <input class="input-text" name="password" type="password" size="40" />
			<!--	   
	        <label>
	        	<input name="rememberme" type="checkbox" value="yes" id="rememberme"> 
	        	จำข้อมูลการล๊อกอิน
			</label> 
			-->
        <input class="button" style="float:left;" type="submit" value="&raquo; Sign In" /> 
		<span style="padding:10px;font-size:12px;"><?=anchor('reset', 'Forgot Password?');?></span> 
      </form> 
    </div>
<?php } ?>


    <div class="item">
	<h2>friend's</h2>
    <p>
	<?php
	foreach($lastUser as $row):
		echo "<a class='tipsy-fade' href='" . base_url() . "user/id/". $row['user_id'] ."'  title='" . $this->usermodel->getName($row['user_id']) . "'><img width='42px' height='42px' src='" . $this->usermodel->getAvatar($row['user_id']) . "'></a>";
	endforeach;
	?>
    </p>
    </div>
	
    <div class="item">
	<h2>blog update</h2>
    <p>
		<?php
		if($lastBlog == false){
			echo "ไม่พบข้อมูล";
		} else {
			
			foreach($lastBlog as $lstBlogRow):
			{
				echo "<UL>";
				echo "<li>";
				echo anchor("blog/view/" . $lstBlogRow['blog_id'], $lstBlogRow['blog_name']);
				echo  "&nbsp; - &nbsp;" . $this->usermodel->getName($lstBlogRow['blog_owner']);
				echo "</li>";
				echo "</UL>";
			}
			endforeach;
		}
		?>
    </p>
    </div>

	<div class="item">
	<h2>Present</h2>
    <p>
		<object width="250" height="270"><param name="movie" value="http://www.youtube.com/v/VEBpTvQ4V9o&hl=en_US&fs=1&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/VEBpTvQ4V9o&hl=en_US&fs=1&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="250" height="270"></embed></object>
    </p>
    </div>

	<div class="item">
	<h2>Like :)</h2>
    <p>
		<h3 align="center">
<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fapps%2Fapplication.php%3Fid%3D23567002744&amp;width=250&amp;colorscheme=light&amp;connections=10&amp;stream=false&amp;header=false&amp;height=300" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:300px;" allowTransparency="true"></iframe>
		</h3>
    </p>
    </div>

</div>

</div>
<!-- footer -->
<?php include('footer.php');?>
<!-- footer end -->
</div>
</body>
</html>